package org.example.多对一.biz;

import org.example.多对一.bean.DeptInfo;
import org.example.多对一.bean.EmpInfo;
import org.example.多对一.dao.DeptInfoDAO;
import org.example.多对一.dao.EmpInfoDAO;

public class EmpBiz {
    private EmpInfoDAO eidao = new EmpInfoDAO();
    private DeptInfoDAO didao = new DeptInfoDAO();

    public EmpInfo findEmpById1(int empNo){
        return eidao.findEmpById1(empNo);
    }

    public EmpInfo findEmpById2(int empNo){
        EmpInfo ei = eidao.findEmpById2(empNo);
        DeptInfo di = didao.findDeptById(ei.getDeptno());
        ei.setDi(di);
        return ei;
    }
}
